# -*- coding: utf-8 -*-
# @Time    : 2024/8/30 16:35
# @Author  : qd
# @Email   : 1518603573@qq.com
# @File    : fiance_fkd_add_page.py
# @Software: PyCharm
from pages.base_page import BasePage
from selenium.webdriver.common.by import By
"""添加付款单界面"""
class FkdAddPage(BasePage):
    url="/crm/index.php?m=finance&a=add&t=paymentorder"
    """付款单应付款输入框"""
    fkd_yfk_input_locator = (By.CSS_SELECTOR, "#payables")
    """选中应付款单"""
    fkd_yfk_select_locator = (By.CSS_SELECTOR, "#data > tr > td:nth-child(1) > input[type=radio]")
    """ok按钮"""
    fkd_btn_ok_locator = (By.CSS_SELECTOR,"body > div:nth-child(8) > div.ui-dialog-buttonpane.ui-widget-content.ui-helper-clearfix > div > button:nth-child(1)")
    """金额输入框定位器"""
    fkd_input_money_locator = (By.ID, "money")
    """保存按钮定位器"""
    skd_btn_submit_locator = (By.CSS_SELECTOR,"body > div.container > div.row > div > form > table > tfoot > tr > td:nth-child(2) > input:nth-child(1)")

    """点击添应付款输入框"""
    def click_fkd_yfk_input(self):
        self.driver.find_element(*self.fkd_yfk_input_locator).click()
    """选中应付款"""
    def click_skd_select(self):
        self.driver.find_element(*self.fkd_yfk_select_locator).click()
    """点击ok"""
    def click_fkd_btn_ok(self):
        self.driver.find_element(*self.fkd_btn_ok_locator).click()
    """输入金额"""
    def input_fkd_input_money(self,fkd_money):
        self.driver.find_element(*self.fkd_input_money_locator).send_keys(fkd_money)
    """点击保存"""
    def click_fkd_btn_submit(self):
        self.driver.find_element(*self.skd_btn_submit_locator).click()